Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Workaround for users with different Site Address and WordPress URL settings #285

Closed
wants to merge 3 commits into from

Conversation

lukecarbis
Copy link
Member

@MattKevan I couldn't manage to replicate #270 exactly, but I did replicate the error you referenced. Can you check whether this fix resolves the problem you reported?

@lukecarbis lukecarbis requested a review from kienstra April 14, 2019 00:08
@lukecarbis
Copy link
Member Author

@kienstra Even if this doesn't resolve #270, it does resolve a problem for users with a different Site URL and Home URL. See WordPress/gutenberg#1761.

@kienstra
Copy link
Collaborator

kienstra commented Apr 15, 2019

Looks Good
Question About Where This Should Be Fixed

Hi @lukecarbis,
The code looks good, but do you think Block Lab is the right place to fix this?

You understand this issue better than I do. But in that issue you linked to, it looks like this affects the block editor and the REST API, not just Block Lab: WordPress/gutenberg#1761 (comment)

Given the impact of this issue was a deliberate design decision for the REST API...

It'd be interesting to see how this works for @MattKevan, or if he had this issue with the block editor in general, or only this plugin.

Copy link
Collaborator

@kienstra kienstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't reproduce the issue when I set the WordPress Address (home) to a different URL than the Site Address (siteurl):

different-from-wp-address

With the develop branch checked out, adding blocks worked fine:

diff-site-url

Maybe there's a better way to reproduce this issue, though.

@lukecarbis
Copy link
Member Author

@kienstra I agree that block lab might not be the right place for this fix.

Try reproducing by changing the domain in the URL (not just the path).

@lukecarbis
Copy link
Member Author

Given that this is an issue that affects all dynamic blocks (in fact, any block that makes a REST API call), I'm going to suggest we allow the fix to come from the Gutenberg team.

@lukecarbis lukecarbis closed this Apr 15, 2019
@lukecarbis lukecarbis deleted the bugfix/270-cookie-nonce-invalid branch April 15, 2019 22:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants